<%@page import="iut2.torque.generated.Etudiant"%>
<%@page import="iut2.torque.generated.Groupe"%>
<%@page import="iut2.torque.generated.Note"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.List" %>
			
<jsp:include page="/JSP/header.jsp"/>
	
	<div class="container">		
	
		<div class="hero-unit">
	
			<% List<Groupe> groupsList = (List<Groupe>)request.getAttribute("groups_list"); %>

			<form action='gestionGroupes' method="post">
			<h2>Gestion des groupes</h2>
						
			<input class="btn btn-success" type="submit" value="Tout sauvegarder" />

		
			<table class="table table-striped table-bordered" >
			<tr>
				<th>#</th>
				<th>Nom du groupe</th>
				<th></th>
			</tr>
			<% 
				for (Groupe g : (List<Groupe>)groupsList) { %>
			<tr>
				<td> 
					<%=g.getGroupId()%>
					<input type="hidden" name="maj" value="<%=g.getGroupId()%>" />
					</form>			
				</td> 
				<td> 
					<input type="text" name="groups" value="<%=g.getGroupName()%>" />
				</td> 
				<td>
					<a class="btn btn-danger" href="gestionGroupes?delGrp=<%=g.getGroupId()%>"><i class="icon-remove"></i></a>
				</td>
			</tr>
			<%	} %>	
			
				<td> 
					<%=groupsList.size()+1%>
				</td>
				<form action="gestionGroupes" id="form1" method="POST">
					<td> 
						
						<input type="text" name="addGrp" value="" placeholder="Nom du groupe"/>
					</td>
					
					<td>
						<input type="submit" class="btn-success" value="Ajouter" />
					</td>
				</form>
			</tr>
		</table>
		
		</div>
	
	</div>
	
<jsp:include page="/JSP/footer.jsp"/>